<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>欢迎访问产品运营互动中心！</title>
<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<script src="<s:url value="/script/jquery_last.js"/>" type="text/javascript"></script>
<script type="text/javascript" src="<s:url value="/script/easyajax.js"/>"></script>
<script type="text/javascript" src="<s:url value="/script/selfResize.js"/>"></script>
<script type="text/javascript" src="<s:url value="/components/datepicker/WdatePicker.js"/>"></script>
<script>
function show(url){
	window.open(url);
}
function initLoad(){
	f_iframeResize();
}
window.onload = initLoad;

var documentIds="";						//上传附件id
var curProcessDetailId="";		//当前节点id
var isSubmitFlag=false;				//判断需要上传文档是否可以了，是否可以提交

</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td>
		<table width="100%" border="0" cellpadding="0" cellspacing="0" background="<s:url value="/images/new/gxzl_index_2.gif"/>">
			<tr>
				<td width="20" height="32">&nbsp;</td>
				<td width="20"><img
					src="<s:url value="/images/new/dq_dot.gif"/>" width="15"
					height="12" /></td>
					<td>当前位置：业务需求交互单管理</td>

				</tr>
		</table>
		</td>
	</tr>
	
  <tr> 
    <td class="leftbg"> 
      <table width="98%" height="400" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
        <tr>
		<td valign="top">
		  <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
			<tr>
			  <td valign="top">
				<s:form action="saveTransactProcessStatus.action" namespace="/security" method="post" enctype="multipart/form-data">
				  <input type="hidden" name="transactProcessStatus.id" value="${transactProcessStatus.id}">
				  <input type="hidden" name="advice" value="">
				  
				  <table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td>
						<TABLE width="96%" border="0" height="26" cellPadding=0 cellSpacing=1>
						  <TR height=30> 
							<TD align=left> 
								<input type="submit" name="Submit" value="保 存" onclick="return save();">
								<s:property value="#businessRequest"/>
								<input type="button" name="Submit" value="提 交" onclick="document.forms[0].action='submitProcess.action';beforeSaveInfo();">

								
								<s:if test="transactProcessStatus.id!=null && transactProcessStatus.currProcessConfigDetail.nodeType!=0">
								<input type="button" name="Submit" value="回 退" onclick="return backProcess();">
								</s:if> 
								<input type="button" value="返 回" onClick="location.href='curBusinessRequest.action'">
								
							</TD>
							<TD align=right> 
								<s:if test="businessRequest.id!=null">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<input type="button" name="Submit" value="填写进展描述" onclick="progress();"/>
									<input type="button" name="Submit" value="申请延迟" onclick="delay();"/>
								</s:if>
							</TD>
						  </TR>
						</table>

				<table width="100%" border="0" cellspacing="0" cellpadding="7" align="center" class=tablecolor2>
				  <tr>
					<td background="<s:url value="/images/catalog_manage_bbs_3.gif"/>" colspan="4"><span style="margin-top:0px;margin-left:14px"><img src="<s:url value="/images/catalog_manage_12.gif"/>" width=13 height=13 alt=""></span> <strong>流程信息</strong></td>
				  </tr>
                  <tr>
                    <td width="14%" bgcolor="D6E3FA"><div align="right" class="STYLE2">当前状态：</div></td>
                    <td width="36%">
                    	<input type="text" name="transactProcessStatus.currProcessConfigDetail.name" 
                    	value="${transactProcessStatus.currProcessConfigDetail.name}"  size="40" class="input_nob" readonly>
                    	<input type="hidden" name="transactProcessStatus.currProcessConfigDetail.id" value="${transactProcessStatus.currProcessConfigDetail.id}" >
                    </td>
                    <td bgcolor="D6E3FA" width="14%"><div align="right" class="STYLE2">当前办理人：</div></td>
                    <td width="36%">${sessionScope.LOGINUSER_CONTEXT.currUser.person.name}<input type="hidden" name="transactProcessStatus.currTransactor" value="${transactProcessStatus.currTransactor}"  size="40" readonly></td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2"><font color="red">*</font>当前流程：</div></td>
                    <td colspan="3">
          <s:if test="processConfigs==null">
          	<input type="radio"  name="transactProcessStatus.currProcessConfig.id" onClick="initDetail(this.value);" value="<s:property value="transactProcessStatus.currProcessConfig.id" />" ><s:property value="transactProcessStatus.currProcessConfig.name" />
        	</s:if>	
        	<s:else>
						<s:iterator value="processConfigs">
							<input type="radio"  name="transactProcessStatus.currProcessConfig.id" onClick="initDetail(this.value);" value="<s:property value="id" />"><s:property value="name" />
						</s:iterator>
        	</s:else>
					
					</td>
                    </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2"><font color="red">*</font>下一步骤：</div></td>
                    <td>
											<select name="nextStep" id="nextStep" onchange="setPersonSelect(this.value);"></select>
										</td>
                    <td bgcolor="D6E3FA" rowspan="2">
                    	<div id="nextPersonDis" name="nextPersonDis" align="right"><font color="red">*</font>下一办理人：</div>
                    </td>
										<td rowspan="1"><div id="personTable" name="personTable" align="right">
						<TABLE width="100%" border="0" height="26" cellPadding=0 cellSpacing=1>
						  <TR>
							<TD align=left>
											<input type="hidden" id="nextPersonName" name="nextPersonName" value="">
											<input type="hidden" id="nextPerson" name="nextPerson" value="">
				              <select name="personId" id="personId" style="width:220px;height:110px" property="id" labelProperty="name" >
								      </select>
							</TD>
							<TD align=left>
												<input type="button" name="selType" value="选择人员" onClick="selectMainPerson()">
							</TD>
							</TR>
						</TABLE></div>
											
										</td>
                  </tr>
                  <tr>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2"><font color="red">*</font>办理意见：</div></td>
                    <td colspan="3">
											<textarea cols="90" rows="4" id="transactInfo" name="transactorInfo" ></textarea>					
                    </td>
                  </tr>
                  <tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2"><font color="red">*</font>附&nbsp;&nbsp;&nbsp;&nbsp;件：</div></td>
                    <td colspan="3">
											<input name="附件上传" type="button" value="附件上传" onClick="uploadDocument();">
					  				</td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">流程事项说明：</div></td>
                    <td colspan="3">
                    	${transactProcessStatus.currProcessConfigDetail.flowExplain}
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">处理时限说明：</div></td>
                    <td colspan="3">
                    	${transactProcessStatus.currProcessConfigDetail.limitExplain}
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">办理时限：</div></td>
                    <td colspan="3">
                    	<s:date name="transactProcessStatus.timeLimit" format="yyyy年MM月dd日"/>
                    </td>
                  </tr>
                  
                </table>
                
                
                <table width="100%" border="0" cellspacing="0" cellpadding="7" align="center" class=tablecolor2>
								  <tr>
									<td background="<s:url value="/images/catalog_manage_bbs_3.gif"/>" colspan="4"><span style="margin-top:0px;margin-left:14px"><img src="<s:url value="/images/catalog_manage_12.gif"/>" width=13 height=13 alt=""></span> <strong>基本信息</strong></td>
								  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">名&nbsp;&nbsp;&nbsp;&nbsp;称：</div></td>
                    <td colspan="3">
                    	<input type="text" name="businessRequest.name" value="${businessRequest.name}" class="input_nob" size="110" readonly>
                    </td>
                  </tr>
                  <tr>
                  	<input type="hidden" name="businessRequest.id" value="<s:property value="businessRequest.id" />"/>
                    <td bgcolor="D6E3FA" width="14%"><div align="right" class="STYLE2">发 起 人：</div></td>
                    <td width="36%">${businessRequest.startPerson}
                    </td>
                    <td bgcolor="D6E3FA" width="14%"><div align="right" class="STYLE2">发起部门：</div></td>
                    <td width="36%">${businessRequest.startDept}
                    	<input type="hidden" name="businessRequest.startPerson" value="${businessRequest.startPerson}" >
                    	<input type="hidden" name="businessRequest.startDept" value="${businessRequest.startDept}" >
                    	<input type="hidden" name="businessRequest.prodPerson.id" value="${businessRequest.prodPerson.id}" >
                    	<input type="hidden" name="businessRequest.prodDept.id" value="${businessRequest.prodDept.id}" >
                    	<input type="hidden" name="businessRequest.phone" value="${businessRequest.phone}" >
                    	<input type="hidden" name="businessRequest.callMode" value="${businessRequest.callMode}" >
                    	<input type="hidden" name="businessRequest.content" value="${businessRequest.content}" >
                    	<input type="hidden" name="businessRequest.currStatus" value="${businessRequest.currStatus}" >
                    	<input type="hidden" name="businessRequest.currUser" value="${businessRequest.currUser}" >
                    	<input type="hidden" name="businessRequest.officialNo" value="${businessRequest.officialNo}" >
                    	<input type="hidden" name="businessRequest.officialName" value="${businessRequest.officialName}" >
                    	
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">需求单号：</div></td>
                    <td>
                    	<input type="text" name="businessRequest.reqCode" value="${businessRequest.reqCode}" class="input_nob" size="40" readonly>
                    </td>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2"></div></td>
                    <td>
					  				</td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">期望完成时间：</div></td>
                    <td>
												<!--input type="text" name="startTime" size="14" class="Wdate" onFocus="new WdatePicker(this)"-->
												<s:date name="businessRequest.advanTime" format="yyyy年MM月dd日"/>
												<input name="businessRequest.advanTime" type="hidden" value="${businessRequest.advanTime}">
                    </td>
                    <td bgcolor="D6E3FA" width="14%"><div align="right" class="STYLE2">发起时间：</div></td>
                    <td width="36%">
												<s:date name="businessRequest.begin" format="yyyy年MM月dd日"/>
												<input name="businessRequest.begin" type="hidden" value="${businessRequest.begin}"><input name="businessRequest.end" type="hidden" value="${businessRequest.end}">
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA" width="14%"><div align="right" class="STYLE2">产品经理：</div></td>
                    <td width="36%">
                    	<input type="text" name="prodPerson" value="${businessRequest.prodPerson.name}" class="input_nob" size="40" readonly>
                    </td>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">产品部门：</div></td>
                    <td>
                    	<input type="text" name="prodDept" value="${businessRequest.prodDept.fullName}" class="input_nob" size="40" readonly>
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA" width="14%"><div align="right" class="STYLE2">需求类别：</div></td>
                    <td width="36%">
                    	<input type="text" name="businessRequest.type" value="${businessRequest.type}" class="input_nob" size="40" readonly>
                    </td>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">重要性：</div></td>
                    <td>
                    	<input type="text" name="businessRequest.importance" value="${businessRequest.importance}" class="input_nob" size="40" readonly>
					  				</td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">内&nbsp;&nbsp;&nbsp;&nbsp;容：</div></td>
                    <td colspan="3">${businessRequest.content}
											<!--s:textarea name="businessRequest.content" theme="css_xhtml" cols="96" rows="4" readonly="readonly"/-->
					  				</td>
                  </tr>
                  <tr> 
                    <td bgcolor="D6E3FA"> <div align="right" class="STYLE2">附&nbsp;&nbsp;&nbsp;&nbsp;件：</div></td>
                    <td colspan="3">
											<table width="98%" border="0" class=tablecolor2>
												<tr>
													<td width="*" align="center" bgcolor="D6E3FA">附件名称</td>
													<td width="20%" align="center" bgcolor="D6E3FA">附件类型</td>
													<td width="12%" align="center" bgcolor="D6E3FA">办理步骤</td>
													<td width="12%" align="center" bgcolor="D6E3FA">上传人</td>
													<td width="12%" align="center" bgcolor="D6E3FA">上传时间</td>
												</tr>
												<s:iterator id="reqDocu" value="reqDocus">
												<input type="hidden" name="attachIDs" value="<s:property value="id" />"/>
												<tr>
													<td>
														<a href="<s:url value="/bpm/showDocu.action?reqDocu.id="/><s:property value="id" />"
															target="_blank">
															<s:property value="fullName" />
														</a>
													</td>
							<td align="center"> 
								<s:if test="docType==null">
									其他附件
								</s:if>	
								<s:else>
									<s:property value="docType.name"/>
								</s:else>	
							</td>
							<td align="center"> 
									<s:property value="processDetail.name"/>
							</td>
							
													<td>
														<s:property value="creator"/>
													</td>
													<td>
														<s:date name="begin" format="yyyy年MM月dd日"/>
													</td>
							
												</tr>
												</s:iterator>

											</table>

					  				</td>
                  </tr>
                </table>


				<table width="100%" border="0" cellspacing="0" cellpadding="7" align="center" class=tablecolor2>
				  <tr>
					<td background="<s:url value="/images/catalog_manage_bbs_3.gif"/>" colspan="4"><span style="margin-top:0px;margin-left:14px"><img src="<s:url value="/images/catalog_manage_12.gif"/>" width=13 height=13 alt=""></span> <strong>办理过程</strong></td>
				  </tr>
				  <tr>
           			<td height="167" colspan="4">
						<s:iterator value="prodAdvReqs" status="st">
					 <table width="100%" border="0" class=tablecolor2>
						<tr>
							<td align="left" width="100%">${tranReason}</td>
						</tr>
					</table>
						</s:iterator>
           				
					 <table width="100%" border="0" class=tablecolor2>
             <tr>
               <td align="center" bgcolor="D6E3FA" width="5%">序号</td>
               <td align="center" bgcolor="D6E3FA" width="9%">办理步骤</td>
               <td align="center" bgcolor="D6E3FA" width="32%">事项</td>
               <td align="center" bgcolor="D6E3FA" width="8%">办理人员</td>
               <td align="center" bgcolor="D6E3FA" width="12%">办理时间</td>
               <td align="center" bgcolor="D6E3FA" width="*">办理意见</td>
             </tr>
             	<%int n = 1; %>
						<s:iterator value="procTranRecords" status="st">
							<%n++; %>
                          <tr>
                            <td align="center"><s:property value="#st.getIndex()+1"/></td>
                            <td><s:property value="processStep.name"/></td>
                            <td  valign="top"  width="200px" style="word-break:break-all;word-wrap:break-word;" >
							<s:iterator value="reqProgresses" status="rp">
								【<s:date name="createTime" format="yyyy年MM月dd日"/><!--s:property value="createTime"/-->】
								<s:property value="reqProg"/>
								&nbsp;完成<s:property value="percent"/>%.
								<br/>
							</s:iterator>

							<s:iterator value="reqDelayes" status="rp">
								【<s:date name="createTime" format="yyyy年MM月dd日"/><!--s:property value="createTime"/-->】
								<s:property value="delayReason"/>
								&nbsp;延迟时长<s:property value="delayTime"/>周. 
								<br/>
							</s:iterator>
							</td>
                            <td><s:property value="transactor.name"/></td>
                            <td><s:property value="transactTime"/></td>
                            <td><s:property value="transactInfo"/></td>

                          	</tr>
                          	</s:iterator>
                          	<tr style="color: red;">
                          	<td align="center"><%=n %></td>
                            <td >${transactProcessStatus.currProcessConfigDetail.name}</td>
                            <td  valign="top"  width="200px" style="word-break:break-all;word-wrap:break-word;" >
							<s:iterator value="reqProgressess" status="rps">
								【<s:date name="createTime" format="yyyy年MM月dd日"/><!--s:property value="createTime"/-->】
								<s:property value="reqProg"/>
								&nbsp;完成<s:property value="percent"/>%.
								<br/>
							</s:iterator>
							<s:iterator value="reqDelayss" status="rp">
								【<s:date name="createTime" format="yyyy年MM月dd日"/><!--s:property value="createTime"/-->】
								<s:property value="delayReason"/>
								&nbsp;延迟时长<s:property value="delayTime"/>周.
								<br/>
							</s:iterator>
							</td>
                            <td >${sessionScope.LOGINUSER_CONTEXT.currUser.person.name}</td>
                            <td > </td>
                            <td > </td>

                          </tr>
                        </table>
					</td>
                  </tr>	 
                </table>
				</td>
              </tr>
            </table>
										
						</td>
					</tr>
                  </table>
				  </s:form>
				</td>
			</tr>
          </table>
		</td>
		</tr>
	  </table>
	</td>
	</tr>
</table>
</body>
</html>
<script>
<!--

	function uploadFile(id) {
		window.open('<s:url value="/common/uploadFile.action?attach.refEntity=PRODUCTREFERENCE&attach.refEntityID="/>'+ id, "uploadfile",
						"dialogWidth=420px;dialogHeight=300px");
	}
	
	function addComponent()
	{
		var uploadHTML=document.createElement("<input type='file'　name='upload'/>");
		document.getElementById("files").appendChild(uploadHTML);
		uploadHTML=document.createElement("<p/>");
		document.getElementById("files").appendChild(uploadHTML);
	}
	
function selectMainPerson(){
	var url="<s:url value='/' escapeAmp='false'/>"+"organ/selectPerson.action";	
	var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:960px;dialogHeight:640px;scroll:yes;");
	if(returnData){
		fillTable(returnData);
	}
}
function fillTable(list){
	var idArr=list[0].split(",");
	var nameArr=list[1].split(",");
	var obj=document.getElementById("personId");
	clearList(obj);
	    for (var I = 0 ; I < idArr.length ; I++) {
		    var item = idArr[I];
	      var option=document.createElement("option");
	    	option.value=idArr[I];
	    	option.text=nameArr[I];
	    	obj.add(option);
	    }
}

//填写需求进展 
function progress(){
    var url="<s:url value='/' escapeAmp='false'/>"+"bpm/viewReqProgress.action?businessRequest.id=${businessRequest.id}"+
    "&transactProcessStatus.currProcessConfig.id=${transactProcessStatus.currProcessConfig.id}"+"&transactProcessStatus.id=${transactProcessStatus.id}";
	 var returnData=window.open(url,'newwindow',"width:350,height:300,location=no,menubar=no, scrollbars=no,toolbar=no,status:no,scroll=yes");
}
//填写需求延迟
function delay(){
    var url="<s:url value='/' escapeAmp='false'/>"+"bpm/viewReqDelay.action?businessRequest.id=${businessRequest.id}";
	 var returnData=window.open(url,'newwindow',"width:350,height:300,location=no,menubar=no, scrollbars=no,toolbar=no,status:no,scroll=yes");
}

function selectPerson(){
    var url="<s:url value='/' escapeAmp='false'/>"+"organ/toOrganTree.action?type=&path=toPersonTree&module=checkbox&date=<%=System.currentTimeMillis()%>";
	 var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:650px;dialogHeight:600px;scroll:yes;");
	 if(returnData){
	 	document.forms[0]["personNames"].value=returnData[1];
	 	document.forms[0]["persons"].value=returnData[0];
	 }
}


var personAjax=new AjaxObj();
function getRef(processConfigDetailId){	
	callSynchronized("<s:url value="/bpm/viewTransactorByType.action"/>?conds.id="+processConfigDetailId+"&conds.businessRequestId="+${businessRequest.id},function(XML){//同步调用
	    personAjax=new AjaxObj();
	    personAjax.xml=XML.responseXML;
	    personAjax.menuId="personId";
	    //personAjax.menuId="readPersonId";
	    //alert(personAjax.xml.xml);
	    personAjax.createMenu();
	    var obj=document.getElementById("pDiv1");
	    if(personAjax.length()==0){
	    	if(obj){
	    		obj.style.display="";
	    	}
	    }else{
	    	if(obj){
	    		obj.style.display="none";
	    	}
	    }
	});
}

var currProcessConfigDetailId= ${transactProcessStatus.currProcessConfigDetail.id}+"";

var curPoint=new Array();
var subPoint=new Array();
<s:iterator value="nextTeps" status="st">
curPoint[<s:property value="#st.getIndex()"/>]=new Array("<s:property value="processDetail.id"/>","<s:property value="processDetail.name"/>","<s:property value="processDetail.processConfig.id"/>","<s:property value="processDetail.nodeType"/>");
subPoint[<s:property value="#st.getIndex()"/>]=new Array("<s:property value="nextConfig.id"/>","<s:property value="nextConfig.name"/>","<s:property value="nextConfig.processConfig.id"/>","<s:property value="nextConfig.nodeType"/>");
</s:iterator>

var list1=document.all["nextStep"];
var detailName=document.all["transactProcessStatus.currProcessConfigDetail.name"];
var detailId=document.all["transactProcessStatus.currProcessConfigDetail.id"];

function initDetail(val){
	if(curPoint&&val&&curPoint.length>0){
			clearList(list1);
		if(currProcessConfigDetailId&&currProcessConfigDetailId!=""){
			for(var i=0;i<curPoint.length;i++){
				if(curPoint[i][2]==val&&curPoint[i][0]==detailId.value){			//当id等于流程id时，判断是开始节点：0，生成当前状态
				  var myOption=document.createElement("option");
				  myOption.setAttribute("value",subPoint[i][0]);
				  myOption.appendChild(document.createTextNode(subPoint[i][1]));
				  list1.appendChild(myOption);
				}
			}
		////在下一步骤中加入“转派”
				  var myOption=document.createElement("option");
				  myOption.setAttribute("value","ZHP");
				  myOption.appendChild(document.createTextNode("转派"));
				  list1.appendChild(myOption);
		}else{
			for(var i=0;i<curPoint.length;i++){
				if(curPoint[i][2]==val&&curPoint[i][3]=="0"){			//当id等于流程id时，判断是开始节点：0，生成当前状态
					detailId.value=curPoint[i][0];
					detailName.value=curPoint[i][1];
				  var myOption=document.createElement("option");
				  myOption.setAttribute("value",subPoint[i][0]);
				  myOption.appendChild(document.createTextNode(subPoint[i][1]));
				  list1.appendChild(myOption);
				}
			}
		}
		
	}
	
	setPersonSelect(detailId.value);
initLoad();
}
function setPersonSelect(){
	clearList(document.all["personId"]);
	var nextStep=document.all["nextStep"].options.value;
		for(var i=0;i<subPoint.length;i++){
			if(subPoint[i][0]==nextStep){
				if(subPoint[i][3]=="1"){				//当选择下一步骤为结束时，隐藏下一办理人，并返回；否则为下一办理人填充值-pany-091021
					document.all["nextPersonDis"].style.display="none";
					document.all["personTable"].style.display="none";
					return;
				}
			}
		}
		document.all["nextPersonDis"].style.display="";
		document.all["personTable"].style.display="";
	getRef(detailId.value);
	
}
function clearList(sel){
	if(sel&&sel.options&&sel.options.length>0){
		for(var i=sel.options.length;i>0;i--){
			sel.removeChild(sel.options[i-1]);
		}
	}
}

if(document.all["transactProcessStatus.currProcessConfig.id"][0]){
	document.all["transactProcessStatus.currProcessConfig.id"][0].click();
}
else if(document.all["transactProcessStatus.currProcessConfig.id"]){
	document.all["transactProcessStatus.currProcessConfig.id"].click();
}

function beforeSaveInfo(){
	//提交时，判断必选下一步骤；如下一步骤为结束节点时，不必选下一办理人，否则判断必选下一办理人
	if(isNullSel(document.all["nextStep"])){
		alert("请选择下一步骤!");
		return false;
	}
	var nextStep=document.all["nextStep"].options.value;
	if(isNullSel(document.all["personId"])){
		for(var i=0;i<subPoint.length;i++){
			if(subPoint[i][0]==nextStep){
				if(subPoint[i][3]=="1")
					break;
				else{
					alert("请选择下一办理人!");
					return false;
				}
			}
		}
	}
	if(document.all["businessRequest.name"]&&document.all["businessRequest.name"].value==""){
				alert("请输入名称!");
				return false;
	}
	if(document.all["businessRequest.content"]&&document.all["businessRequest.content"].value==""){
				alert("请输入内容!");
				return false;
	}
	if(document.all["transactorInfo"]&&document.all["transactorInfo"].value==""){
				alert("请输入办理意见!");
				return false;
	}
	
	//提交时，给办理人赋值
	var personSelect=document.all["personId"];
	
//	document.all["nextPersonName"].value=document.all["personId"].options[document.all["personId"].selectedIndex].innerText;
//	document.all["nextPerson"].value=personSelect.value;
	submit1();
	list();
	document.forms[0].submit();
	return true;
}
function save(){
	if(document.all["businessRequest.name"]&&document.all["businessRequest.name"].value==""){
				alert("请输入名称!");
				return false;
	}
	if(document.all["businessRequest.content"]&&document.all["businessRequest.content"].value==""){
				alert("请输入内容!");
				return false;
	}
	submit1();
	return true;
}
	
function list(){
	var sel =document.all["personId"];
	var op=sel.options;
	var val="";
	var name="";
	for (var i=0;i<op.length;i++){
		if(op[i].selected ==true){
			val+=op[i].value+",";
			name+=op[i].text+",";
		}
	}
	if(val!=""){
		val=val.substring(0,val.length-1);
	}
	if(name!=""){
		name=name.substring(0,name.length-1);
	}
	document.all["nextPersonName"].value=name;
	document.all["nextPerson"].value=val;
}
function isNullSel(obj){
	if(obj&&obj.options&&obj.options.selectedIndex!=-1&&obj.options[obj.options.selectedIndex].value!=""){
		return false;
	}
	return true;
}

function submit1(){
	/*
	var time2=document.all['startTime'].value;
	if(time2.length==10){
		document.all['businessRequest.startTime'].value=document.all['startTime'].value+" 00:00:00";
	}
	*/
	if(curProcessDetailId!=document.all['transactProcessStatus.currProcessConfigDetail.id'].value){
		documentIds="";
	}
}


function uploadDocument(){
	var processDetailId=document.all['transactProcessStatus.currProcessConfigDetail.id'].value;
	var businessRequestId=document.all['businessRequest.id'].value;
  var url="/bpm/uploadDocument.action?processDetailId="+processDetailId+"&businessRequestId="+businessRequestId+"&docIds="+documentIds;
   
	var returnData=window.open(url,null,"height=400,width=550,status=yes,toolbar=no,menubar=no,location=no");
	 //var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:600px;dialogHeight:270px;scroll:no;");
	 if(returnData){
	 	//document.forms[0]["nextPersonName"].value=returnData[1];
	 	//document.forms[0]["nextPerson"].value=returnData[0];
	 }
}
function selectProdPerson(){
    var url="<s:url value='/' escapeAmp='false'/>"+"organ/toOrganTree.action?type=&path=toPersonTree&module=radio&date=<%=System.currentTimeMillis()%>";	 
    var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:650px;dialogHeight:600px;scroll:yes;");
	 if(returnData){
	 	document.forms[0]["prodPerson"].value=returnData[1];
	 	document.forms[0]["businessRequest.prodPerson.id"].value=returnData[0];
	 }
}
function backProcess(){
	if(!confirm("你确认要执行【回退】")){
		return false;
	}
  var url="<s:url value='/' escapeAmp='false'/>"+"bpm/inputMessage.action?advice=1";
  var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:550px;dialogHeight:250px;scroll:yes;");
	if(returnData){
		document.forms[0]["advice"].value=returnData;
	}else{
		return false;
	}
	document.forms[0].action='backProcess.action';
	document.forms[0].submit();
	return true;
}
	
-->
</script>